﻿@model SchoolCommunicationSystem.Models.UpdateClass

@{
    ViewBag.Title = "Sửa thông tin lớp học";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.datepicker-vi-VN.js")" type="text/javascript"></script>
<script>
$(function () {
    $.validator.addMethod('date',
    function (value, element) {
        if (this.optional(element)) {
            return true;
        }
        var ok = true;
        try {
            $.datepicker.parseDate('dd/mm/yy', value);
        }
        catch (err) {
            ok = false;
        }
        return ok;
    });
    $(".datefield").datepicker({ dateFormat: 'dd/mm/yy', yearRange: '1950:2020', changeYear: true, changeMonth: true });
});
</script>
<h2>Sửa thông tin lớp học</h2>
@using (Html.BeginForm())
{
    <fieldset>
        <legend>Lớp</legend>
        @Html.ValidationSummary(true)
        <div class="editor-label">
            @Html.Label("Tên lớp học:")
        </div>
        <div class="editor-field">
            @Html.HiddenFor(model => model._classID)
            @Html.HiddenFor(model => model.schoolYearIDList)
        </div>

        <div class="editor-field">
            @Html.EditorFor(model => model._className)
            @Html.ValidationMessageFor(model => model._className)
        </div>
        <div class="editor-label">
            @Html.Label("Ngày bắt đầu:")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model._startDate, "{0:d}")
            @Html.ValidationMessageFor(model => model._startDate)
        </div>
        <div class="editor-label">
            @Html.Label("Năm học:")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model._schoolYearID, Model.SchoolYearSelectList, "--")
        </div>
        <div class="editor-label">
            @Html.Label("Giáo viên chủ nhiệm:")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.teacherID, Model.TeacherSelectList, "--")
        </div>
        <br />
    </fieldset>
    <div style="float: left">
        <button type="submit" id="btnUpdate" name="Command" value="Update" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
            <span class="ui-button-text">Cập nhật</span></button>
        &nbsp; &nbsp;
    </div>
}